package com.itheima.config;

import com.itheima.service.DeptService;
import org.dom4j.io.SAXReader;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration // 配置类
public class CommonConfig {

    @Bean(name = "reader")//将当前方法的返回值对象交给Ioc容器管理，成为Ioc容器bean
    //通过@Bean注解的name/value属性指定bean名称，如果未指定，默认是方法名
    public SAXReader saxReader(DeptService deptService) {
        System.out.println(deptService);
        return new SAXReader();
    }
}
